home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #5 & #6
/
Amiga Plus CD - 1995 - No. 5 and 6.iso
/
pd
/
netz
/
term
/
extras
/
source
/
gtlayout-source.lha
/
LTP_MoveToWindow.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-13
|
792b
|
37 lines
/* GadTools layout toolkit
**
** Copyright © 1993-1995 by Olaf `Olsen' Barthel
** Freely distributable.
*/
#include "gtlayout_global.h"
VOID __regargs
LTP_MoveToWindow(LayoutHandle *handle)
{
if(V39 && handle -> MoveToWindow)
{
WORD left,top,width,height;
LTP_GetDisplayClip(handle->Screen,&left,&top,&width,&height);
if(handle -> Window -> Width < width)
left = (width - handle -> Window -> Width) / 2;
else
left = 0;
if(handle -> Window -> Height < height)
top = (height - handle -> Window -> Height) / 2;
else
top = 0;
if((left = handle -> Window -> LeftEdge - left) < 0)
left = 0;
if((top = handle -> Window -> TopEdge - top) < 0)
top = 0;
ScreenPosition(handle -> Screen,SPOS_MAKEVISIBLE,left,top,left + width - 1,top + height - 1);
}
}